package org.example.blog.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.blog.model.UserInfo;

@Mapper
public interface UserInfoMapper {
    // 用户登陆的时候需要进行的数据库操作
    //1. 根据用户名查找用户信息, 对比密码是否正确

    @Select("select * from user where user_name =#{userName} and delete_flag=0")
    UserInfo queryByName(String userName);

    // 1. 根据用户id查询用户信息
    @Select("select  * from user where id = #{id} and delete_flag=0")
    UserInfo queryById(Integer id);

}
